package com.neu.questionnaireplus.service;

import com.neu.questionnaireplus.entity.Answerer;
import com.neu.questionnaireplus.entity.Group;
import com.neu.questionnaireplus.entity.GroupToAnswerer;
import java.util.List;

public interface GroupService {

    Group queryGroupByGroupname(String groupname);

    /**
     * @Description: 查询所有群组
     * @Param: []
     * @return: java.util.List<com.neu.questionnaireplus.entity.Group>
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    List<Group> queryGroup();

    /**
     * @Description: 查询未被删除的群组
     * @Param: []
     * @return: java.util.List<com.neu.questionnaireplus.entity.Group>
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/31
     */
    List<Group> queryExistGroup();

    /**
     * @Description: 模糊查询群组
     * @Param: [group]
     * @return: java.util.List<com.neu.questionnaireplus.entity.Group>
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    List<Group> selectGroupList(Group group);

    /**
     * @Description: 根据id查询群组并返回
     * @Param: [id]
     * @return: com.neu.questionnaireplus.entity.Group
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    Group queryGroupByID(String id);

    /**
     * @Description: 插入一个Group进数据库
     * @Param: [group]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    boolean insertGroup(Group group);

    /**
     * @Description: 根据id更新群组
     * @Param: [group]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    boolean updateGroup(Group group);

    /**
     * @Description: 根据id删除群组
     * @Param: [id]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    boolean deleteGroup(String id);

    /**
     * @Description: 通过群组id验证群组内是否有用户
     * @Param: [id]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    boolean hasUserGroup( String id);

    /**
     * @Description: 通过群组的groupname模糊查询群组
     * @Param: [groupname]
     * @return: java.util.List<com.neu.questionnaireplus.entity.Group>
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/30
     */
    List<Group> queryGroupByName( String groupname);

    /**
     * @Description: 根据群组状态做为依据修改群组信息
     * @Param: [group]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/31
     */
    boolean modifyGroupInfo(Group group);

    /**
     * @Description:  根据群组状态做为依据逻辑删除群组信息
     * @Param: [group]
     * @return: boolean
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/10/31
     */
    boolean deleteGroupInfo(Group group);

    /**
     * @Description: 查询group下的所有answerer
     * @Param: [groupId]
     * @return: java.util.List<com.neu.questionnaireplus.entity.Answerer>
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/11/3
     */
    List<Answerer> queryAnswererByGroup(String groupId);

    /**
     * @Description: 通过groupId查询答者和群组的关系
     * @Param: [groupId]
     * @return: java.util.List<com.neu.questionnaireplus.dao.GroupToAnswerDao>
     * @Author: ~FHX~ (:TSunS:)
     * @Date: 2022/11/3
     */
    List<GroupToAnswerer> queryRelationshipByGroupId(String groupId);


    /**
    * @Description: 在群组中删除答者
    * @Param: [groupId, answererId]
    * @return: boolean
    * @Author: ~FHX~ (:TSunS:)
    * @Date: 2022/11/3
    */
    boolean deleteAnswererFromGroup(String groupId,String answererId);
}
